# =====================================================
# Makefile for HEAT SPECTRAL LIBRARY
# Copyright (C) 2009, Altieri Michele, Stefanoni Andrea
# =====================================================

# Name and directory for the library
LIBNAME = libspectral.a
LIBDIR = ../lib/

# Options for building and debugging
DEBUG = -g
OPTIMIZE = -O2 -ftree-vectorize
X86_64 = -m64
CORE2 = -mtune=core2
CPPFLAGS = -Wall $(OPTIMIZE) $(X86_64) $(CORE2)

# Include directories for UMFPACK
SPARSEDIR = /opt/local/include/ufsparse
CXXFLAGS = -I$(SPARSEDIR)

# List of object files
OBJFILES =\
	  functions.o	integrator.o	map2d.o\
	  mesh.o	poly.o		solution.o	umfmatrix.o

# Building library
all:
	make lib

lib: $(OBJFILES)
	ar cru $(LIBDIR)$(LIBNAME) $(OBJFILES)

%.o: %.cpp
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<

clean:
	rm -f $(OBJFILES)

cleanall:
	rm -f $(OBJFILES) $(LIBDIR)$(LIBNAME)
